using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace WsdlStudioLibrary.Windows.Controls.GotDotNetWebServiceStudioGui
{
    public partial class MessagesControl : UserControl
    {
        public MessagesControl()
        {
            InitializeComponent();
        }


        #region UpdateMessagesControl
        internal void UpdateMessagesControl(String currentMessage, WSDynamicProxy.DynamicProxy.Severity severity)
        {
            Color selectionColor = Color.Blue;

            switch (severity)
            {
                case WSDynamicProxy.DynamicProxy.Severity.Info:
                    selectionColor = Color.Blue;
                    break;
                case WSDynamicProxy.DynamicProxy.Severity.Finished:
                    selectionColor = Color.Green;
                    break;
                case WSDynamicProxy.DynamicProxy.Severity.Error:
                    selectionColor = Color.Red;
                    break;
            }

            rtbxMessages.SelectionColor = selectionColor;
            rtbxMessages.SelectedText = currentMessage + Environment.NewLine;

        }
        #endregion

        internal void Clear()
        {
            rtbxMessages.Clear();
        }
    }
}
